package org.lee.visitor.app.user.impl;

import org.lee.visitor.app.user.Grade;
import org.lee.visitor.app.user.Identity;
import org.lee.visitor.app.user.User;
import org.lee.visitor.app.visitor.Visitor;

import java.math.BigDecimal;

/**
 * Teacher
 * 教师
 *
 * @author dralee
 * @date 2021-11-24 14:14:35
 **/
public class Teacher extends User {

    public Teacher(String name, Identity identity, Grade grade, int classNo) {
        super(name, identity, grade, classNo);
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }

    /**
     * 升本率
     *
     * @return
     */
    public double entranceRatio() {
        return BigDecimal.valueOf(Math.random() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
    }
}
